package com.sz.common.pay.pingan.core.client;

import lombok.Data;

/**
 * Function: 对可以用性进行加锁 <br>
 * Author: siqishangshu <br>
 * Date: 2017-10-31 16:16:00
 */
@Data
public final class Connection {

    private String host;
    private int port;
    private boolean lock;

    public Connection(String host, int port) {
        this.host = host;
        this.port = port;
        this.lock = false;
    }

    public boolean isLock(){
        return this.lock;
    }
    public boolean isUnLock(){
        return !this.lock;
    }
    public void unlock(){
        this.lock = false;
    }
    public void lock(){
        this.lock = true;
    }

}
